app.controller("personalonetooneController",function($scope, $http,$routeParams,$filter){
    // 一对一
    $scope.id=$routeParams.id;
    console.log($scope.id)
    $http({
        method: 'POST',
        url: '/OA/student/one2one',
        data:$.param({id:$scope.id}),
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    }).success(function (response) {
        if(response.ok==true){
            console.log(response)
            $scope.datas=response.data;
        }
    })
    function  finddata() {
        var stafftime=$("#date_entry").val();
        stafftime=stafftime.replace(/-/g,'/');
        stafftime=new Date(stafftime);
        stafftime=stafftime.getTime();
        startdate=$filter("date")(stafftime, "yyyy-MM-dd");
        var out_entry=$("#out_entry").val();
        out_entry=out_entry.replace(/-/g,'/');
        out_entry=new Date(out_entry);
        out_entry=out_entry.getTime();
        enddate=$filter("date")(out_entry, "yyyy-MM-dd");
        if(stafftime>out_entry){
            alert("开始日期不能大于结束日期！");
            return
        }
        $http({
            method: 'POST',
            url: '/OA/student/one2one',
            data:$.param({id:$scope.id,startdate:startdate,enddate:enddate}),
            headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
        }).success(function (response) {
            if(response.ok==true){
                console.log(response)
                $scope.datas=response.data;
            }
        })
    }
    $scope.find=function () {
        finddata()
    }
})